const express = require('express');
const router =express.Router();
const expressjoi= require('@escook/express-joi');
const {add_cate_schema,select_cate_schema,update_cate_schema} = require('../schema/artcate')
// 获取文章信息
router.get('/cates',require('../router_heandler/artcate').getcates);
// 新增文章分类
router.post('/addcates',expressjoi(add_cate_schema),require('../router_heandler/artcates/add_cate'))
// 根据ID删除文章分类
router.get('/deletecate/:id',expressjoi(select_cate_schema),require('../router_heandler/artcates/delete_cate'))
// 根据id查找信息
router.get('/cates/:id',expressjoi(select_cate_schema),require('../router_heandler/artcates/selectid_cate'))
// 根据id更新数据
router.post('/updatecate',expressjoi(update_cate_schema),require('../router_heandler/artcates/updatecate'))

module.exports=router;